Home / Data table / Update row
Update a specific record in a api data table. A api data table is a table where the option is enables to change the data table trough the api.
PUT /api/datatable/update/:dataTable/:id
see Using authentication token
Payload should be JSON object with the data of the updated row. It doesn't have to containing all the fields of the row, just the ones that are ought to be updated.Value of the primary key cannot be changed.
{
"valid": true,
"data": null
}
<?php
require_once 'RestOpen.php';
$username = 'my_username';
$password = 'my_password';
$workspaceId = 999;
$tableName = 'your_table_name';
$primaryKey = 'primary_key_to_search';
$updateColumns = array(
'column_name_1'=>'column_value_1',
'column_name_2'=>'column_value_2'
);
$rest = new RestOpen($username, $password, $workspaceId);
$result = $rest->putDataTableUpdateRow($tableName, $primaryKey, $updateColumns);
var_dump($result);